<!-- $Id: trashPosts.html 67 2011-03-26 13:06:51Z nicholasinlove1986@gmail.com $ -->
<include file="Public:pageheader"/>
<script type="text/javascript">
function sortBy(order,sort){
	location.href = "?order="+order+"&sort="+sort;
}
</script>

<div class="form-div">
  <form action="__URL__/trashPosts" name="searchForm" method="post">
    <img src="__PUBLIC__/Images/icon_search.gif" width="26" height="22" border="0" alt="search" />
    关键字 <input type="text" name="keyword" size="15" />
    <input type="submit" value=" 搜索 " class="button" />
  </form>
</div>

<form method="post" action="__URL__/handlePosts" name="listForm" onsubmit="return confirmSubmit_(this);">
  <div class="list-div" id="listDiv">
    <table cellpadding="3" cellspacing="1">
      <tbody>
         <tr>
          <th><input type="checkbox" id="chkOpenAll" onclick="openAll(this)" />
     <a href="javascript:void(0)" onclick="javascript:sortBy('posts_id','<if condition="$sort eq asc_posts_id">desc<else/>asc</if>');" title="点击对列表排序">编号</a>
            <if condition="$sort eq asc_posts_id"><img src="__PUBLIC__/Images/sort_asc.gif"/><else/><img src="__PUBLIC__/Images/sort_desc.gif"/></if></th>
          <th>日志标题</th>
		  <th>日志作者</th>
		  <th>发表时间</th>
		  <th>操作</th>
        </tr>
        <volist name="list" id="vo">
          <tr>
            <td style="background-color: rgb(255, 255, 255);" width="10%" align="center" class="first-cell"><input type="checkbox" id="key" name="key[]" onclick="openAll()" value="{$vo.posts_id}" />{$vo.posts_id}</td>
            <td style="background-color: rgb(255, 255, 255);" align="left" width="50%">{$vo.posts_title}</a></td>
            <td style="background-color: rgb(255, 255, 255);" align="center" width="15%"><span>{$vo.posts_author}</span></td>
            <td style="background-color: rgb(255, 255, 255);" align="center" width="20%"><span>{$vo.posts_addtime|date='Y-m-d H:i:s',###}</span></td> 
			<td align="center">
	<a href="__URL__/handlePosts/act/restore/id/{$vo.posts_id}" title="还原" onclick="return confirm('- 确定要执行还原操作?');" >还原</a> |
	<a href="__URL__/handlePosts/act/drop/id/{$vo.posts_id}" title="删除" onclick="return confirm('- 彻底删除日志信息将无法恢复.\\r\\n- 您确实要删除选中的日志吗?');" >删除</a>
    </td>      
          </tr>
        </volist>
        <tr>
          <td colspan="2">
		<input type="hidden" name="select" value="do" />
		<select name="act" onchange="changeAction()">
        <option value="">请选择...</option>
        <option value="restore">还原</option>
        <option value="drop">移除</option>
		</select>
		  <input type="submit" value=" 确定 " id="btnSubmit" name="btnSubmit" class="button" disabled="true" /></td>
          <td style="background-color: rgb(255, 255, 255);" colspan="6" align="right" nowrap="true"><div class="{$pagestyle}" id="turn-page">{$page}</div></td>
        </tr>
      </tbody>
    </table>
  </div>
</form>

<script language="JavaScript">
function confirmSubmit_(frm, ext)
{
	if (frm.elements['act'].value == 'restore')
	{
	  
		return confirm("- 您确实要把选中日志还原吗?");
	  
	}
	else if (frm.elements['act'].value == 'drop')
	{
	  
		return confirm("- 彻底删除日志信息将无法恢复.\r\n- 您确实要删除选中的日志吗?");
	  
	}
	else if (frm.elements['act'].value == '')
	{
		return false;
	}
	else
	{
		return true;
	}
}

function changeAction()
{
	var frm = document.forms['listForm'];
	
	if (!document.getElementById('btnSubmit').disabled && confirmSubmit_(frm, false))
	{
		frm.submit();
	}
}
</script>
<include file="Public:pagefooter"/> 
